/*
 * Generated via the com.flca generator
 */
package flca.voicenav;
 
import com.flca.DefaultFlcaStartupImpl;
import com.flca.dbs.IRegisterDatabase;

import flca.osm.perst.util.PerstDbHelper;
import flca.voicenav.VoiceNavRegisterDatabases;
public class VoiceNavStartup extends DefaultFlcaStartupImpl 
{
	@Override
	public void initialize() 
	{
		yourSpecificInitializations();
		super.initialize();
		
		VoiceNavContext.INSTANCE.setStarter(this);
	}
	
	private void yourSpecificInitializations() 
	{
		startDatabase();
		logInfo("yourSpecificInitializations" );
	}
	@Override
	public IRegisterDatabase[] getDatabases()
	{
		return VoiceNavRegisterDatabases.getDatabases();
	}
	private void logInfo(String msg) {
		System.out.println(msg);
	}
	
	private void startDatabase() 
	{
		String dbsname;
		if (System.getProperty("os.name").toLowerCase().startsWith("l")) {
			dbsname = "/media/PENDRIVE/maps/OpenStreetMap/data-files/luxemburg.db";
		} else {
			dbsname = "F:/maps/OpenStreetMap/data-files/luxemburg.db"; // TODO
		}

		PerstDbHelper.getInstance().initialize(dbsname);
	}
	
//	private void logError(String msg, Exception ex) {
//		System.out.println(msg + ex);
//	}
	
	private String getDbsName() 
	{
		if (System.getProperty("os.name").toLowerCase().startsWith("l")) {
			return "/home/robin/temp/output/osm-output.db";
		} else {
			return "c:/temp/output/psm-output.db"; // TODO
		}		
	}
}
